<template>
	<div class="liveDataWrap" v-if="this.liveDataWrap==true">
		<a class="liveDataClose" @click="liveDataClose">&#10005;</a>
		<div class="title">
			<span style="width: 334px;">{{type_name}}名称：{{liveDataTitle}}</span>
		</div>
		<p v-if="type_name!='作业'"></p>
		<p v-if="type_name=='作业'">{{type_name}}类型：{{liveDataTeacher}}</p>
		<div class="listDiv">
			<div>
				<b style="color:#9933CC"><i></i>{{listFenlei_text1}}</b>
				<span>{{listFenlei_data1}}</span>
			</div>
			<div>
				<b style="color:#FF6600"><i></i>{{listFenlei_text5}}</b>
				<span>{{listFenlei_data5}}</span>
			</div>
			<div>
				<b style="color:#1AB394"><i></i>{{listFenlei_text4}}</b>
				<span>{{listFenlei_data4}}</span>
			</div>
			<div>
				<b style="color:#FF33CC"><i></i>{{listFenlei_text2}}</b>
				<span>{{listFenlei_data2}}</span>
			</div>
			<div>
				<b style="color:#0099CC"><i></i>{{listFenlei_text3}}</b>
				<span>{{listFenlei_data3}}</span>
			</div>
		</div>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				interface:'',//接口地址
				liveDataWrap:false,
				type_name:'',
				liveDataTitle:'',
				liveDataTeacher:'',
				listFenlei_text1:'',
				listFenlei_text2:'',
				listFenlei_text3:'',
				listFenlei_text4:'',
				listFenlei_text5:'',
				listFenlei_data1:'',
				listFenlei_data2:'',
				listFenlei_data3:'',
				listFenlei_data4:'',
				listFenlei_data5:''
			}
		},
		methods: {
			courseData(){
            	let prefix = this.$parent;
				this.liveDataTitle = prefix.rowName;
				this.type_name = prefix.typeName;
				if(prefix.homeworkType == '1-1'){
					this.liveDataTeacher = '视频作业—学员拍摄或上传视频';
				}else if(prefix.homeworkType == '1-2'){
					this.liveDataTeacher = '文件作业—学员上传文件';
				};
				console.log('kkk:',prefix.coursewareType,prefix.homeworkType);
				if(prefix.coursewareType == '1-'){
					this.$ajax({
	                    url: this.$root.jifuUrl + '/mns/coursewareHomework/coursewareHomeworkDate',
						headers:{'ContentType': 'application/json; charset=utf-8'},
	                    method: 'POST',
	                    data:{coursewareId:prefix.rowId},
	                    success: res => {
	                        if(res.data.code == 200) {
								this.listFenlei_text1 = '报名人数';
								this.listFenlei_text2 = '完成人数';
								this.listFenlei_text3 = '未完成人数';
								this.listFenlei_text4 = '平均分';
								this.listFenlei_text5 = '点赞';
								this.listFenlei_data1 = res.data.data[0];
								this.listFenlei_data2 = res.data.data[1];
								this.listFenlei_data3 = res.data.data[2];
								this.listFenlei_data4 = res.data.data[3];
								this.listFenlei_data5 = res.data.data[4];
	                        }
	                    }
	                });
				}else if(prefix.coursewareType == '2-'){
					this.$ajax({
	                    url: this.$root.jifuUrl + '/mns/coursewareVideo/coursewareVideoData',
						headers:{'ContentType': 'application/json; charset=utf-8'},
	                    method: 'POST',
	                    data:{coursewareId:prefix.rowId},
	                    success: res => {
	                        if(res.data.code == 200) {
								this.listFenlei_text1 = '报名人数';
								this.listFenlei_text2 = '完成人数';
								this.listFenlei_text3 = '未完成人数';
								this.listFenlei_text4 = '平均观看时长';
								this.listFenlei_text5 = '点赞';
								this.listFenlei_data1 = res.data.data[0];
								this.listFenlei_data2 = res.data.data[1];
								this.listFenlei_data3 = res.data.data[2];
								this.listFenlei_data4 = res.data.data[3];
								this.listFenlei_data5 = res.data.data[4];
	                        }
	                    }
	                });
				}else if(prefix.coursewareType == '3-'){
					this.$router.push({
						name:'liveDataType',
						params: {
							updateTitle:prefix.rowName,
							liveBroadcastid:prefix.rowId,
							isBm:prefix.isBm,
							pathKey:prefix.pathKey,
							liveId:prefix.liveId,
							teacherTitle:prefix.teacherTitle,
							lecturerid:prefix.lecturerid
						}
					});
				}else if(prefix.coursewareType == '4-'){
					this.$ajax({
	                    url: this.$root.jifuUrl + '/mns/coursewareFile/coursewareFileData',
						headers:{'ContentType': 'application/json; charset=utf-8'},
	                    method: 'POST',
	                    data:{coursewareId:prefix.rowId},
	                    success: res => {
	                        if(res.data.code == 200) {
								this.listFenlei_text1 = '报名人数';
								this.listFenlei_text2 = '下载人数';
								this.listFenlei_text3 = '未下载人数';
								this.listFenlei_text4 = '阅读人数';
								this.listFenlei_text5 = '点赞';
								this.listFenlei_data1 = res.data.data[0];
								this.listFenlei_data2 = res.data.data[1];
								this.listFenlei_data3 = res.data.data[2];
								this.listFenlei_data4 = res.data.data[3];
								this.listFenlei_data5 = res.data.data[4];
	                        }
	                    }
	                });
				};
				if(prefix.homeworkType == '1-1'){
					this.$ajax({
	                    url: this.$root.jifuUrl + '/mns/coursewareVideo/coursewareVideoData',
						headers:{'ContentType': 'application/json; charset=utf-8'},
	                    method: 'POST',
	                    data:{coursewareId:prefix.rowId},
	                    success: res => {
	                        if(res.data.code == 200) {
								this.listFenlei_text1 = '报名人数';
								this.listFenlei_text2 = '完成人数';
								this.listFenlei_text3 = '未完成人数';
								this.listFenlei_text4 = '平均观看时长';
								this.listFenlei_text5 = '点赞';
								this.listFenlei_data1 = res.data.data[0];
								this.listFenlei_data2 = res.data.data[1];
								this.listFenlei_data3 = res.data.data[2];
								this.listFenlei_data4 = res.data.data[3];
								this.listFenlei_data5 = res.data.data[4];
	                        }
	                    }
	                });
				}else if(prefix.homeworkType == '1-2'){
					this.$ajax({
	                    url: this.$root.jifuUrl + '/mns/coursewareHomework/coursewareHomeworkDate',
						headers:{'ContentType': 'application/json; charset=utf-8'},
	                    method: 'POST',
	                    data:{coursewareId:prefix.rowId},
	                    success: res => {
	                        if(res.data.code == 200) {
								this.listFenlei_text1 = '报名人数';
								this.listFenlei_text2 = '完成人数';
								this.listFenlei_text3 = '未完成人数';
								this.listFenlei_text4 = '平均分';
								this.listFenlei_text5 = '点赞';
								this.listFenlei_data1 = res.data.data[0];
								this.listFenlei_data2 = res.data.data[1];
								this.listFenlei_data3 = res.data.data[2];
								this.listFenlei_data4 = res.data.data[3];
								this.listFenlei_data5 = res.data.data[4];
	                        }
	                    }
	                });
				}
            },
            liveDataClose(){
            	this.liveDataWrap = false;
            }
		}
	}
</script>